package com.huazi.excel;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

/**
 * @author shkstart
 * @create 2021-03-16 23:08
 */
//监听器实体类
public class ExcelListener extends AnalysisEventListener<ExcelData> {
    //一行一行读取数据
    @Override
    public void invoke(ExcelData excelData, AnalysisContext analysisContext) {
        System.out.println("---"+excelData);
    }
    //读取表头信息
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("---"+headMap);
    }
    //读取数据后
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("---"+analysisContext);
    }
}
